package pers.cocoadel.cloud.movie.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pers.cocoadel.cloud.movie.domain.User;

import java.math.BigDecimal;

@RequestMapping("/api")
@RestController
public class ApiController
{

    @GetMapping("/users/{id}")
    public User findById(@PathVariable Long id)
    {
        User user = new User();
        user.setName("Api");
        user.setUsername("api");
        user.setAge(1);
        user.setBalance(BigDecimal.ONE);
        user.setId(id);
        return user;
    }
}
